//
//  def_expression.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_expression_h
#define compilation_def_expression_h

/*
 expression
 : unary_expression assignment_operator comparison_expression {printf("expression\n");}
 | comparison_expression {printf("expression");}
 ; 
 */

struct def_expression{
	void * parent;
	int type;
	struct def_unary_expression * unary_expression;
	enum op assignment_operator;
	struct def_comparison_expression * comparison_expression;
};

struct def_expression * expression_create(void * parent){
	struct def_expression * s = malloc(sizeof(*s));
	s->parent = parent;
	return s;
}

void expression_print(struct def_expression * s){
	switch(s->type){
		case 1:
			unary_expression_print(s->unary_expression);
			operator_print(s->assignment_operator);
		case 2:
			comparison_expression_print(s->comparison_expression);
	}
}
#endif
